package com.tm.chargecar.service.impl;

import com.tm.chargecar.dto.ElectronicCardMonkeyDto;
import com.tm.chargecar.entity.ElectronicCardMonkeyEntity;
import com.tm.chargecar.mapper.ElectronicCardMonkeyMapper;
import com.tm.chargecar.result.Result;
import com.tm.chargecar.service.ElectronicCardMonkeyService;
import com.tm.chargecar.utils.PageUtil;
import com.tm.chargecar.vo.ElectronicCardMonkeyVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 该死了
 * @create 2022-08-24 15:47
 */
@Service
public class ElectronicCardMonkeyServiceImpl implements ElectronicCardMonkeyService {
    @Autowired
    private ElectronicCardMonkeyMapper electronicCardMonkeyMapper;
    //用户卡消费记录查询
    @Override
    public Result ElectronicCardMonkeyQuery(ElectronicCardMonkeyVo electronicCardMonkeyVo) {
        //查询总条数
        PageUtil pageUtil=new PageUtil();
        Long total=electronicCardMonkeyMapper.total(electronicCardMonkeyVo);
        pageUtil.setTotalCount(total);
        //条件查询数据
        List<ElectronicCardMonkeyDto> list=electronicCardMonkeyMapper.ElectronicCardMonkeyQuery(electronicCardMonkeyVo);
         pageUtil.setData(list);
        return Result.SUCCESS(pageUtil);
    }
}
